<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome {

	var $data = array();
	var $ci;
	var $name = 'welcome';

        function __construct()
	{
                $this->ci = &get_instance();
	}

	function init($param)
	{
                $this->data['base_url'] = @$this->ci->base_url;
                $this->data['UID'] = $this->ci->session->userdata('UID');
		$this->data['role'] = $this->ci->session->userdata('role');
		$this->data['container'] = @$param;
	}

	function data()
	{
		return json_encode($dt);
	}

	function load()
	{
		$data['base_url'] = base_url();
		$data['container'] = @$this->data['container'];
		if($this->data['role'] == 'moderator' || $this->data['role'] == 'admin')
			$gadget = $this->ci->parser->parse('templates/moderator.html', $data, true);
		else $gadget = $this->ci->parser->parse('templates/'.$this->name.'.html', $data, true);
		return $gadget;
	}
}
